package com.bw.liuyushan.mvp_lib.Presenter;

import com.bw.liuyushan.mvp_lib.Model.IModel;
import com.bw.liuyushan.mvp_lib.View.IView;

import io.reactivex.disposables.Disposable;

/**
 * ZhuanGao4_MVPTest1
 * file name is : BasePresenter
 * created by Ender on 2021/8/11 14:10.
 * author : Liuyushan
 * Describe:
 */
public class BasePresenter<M extends IModel,V extends IView> implements IPresenter {
    protected M im;//受子类保护
    protected V iv;
    Disposable disposable;//RxJava内存泄露

    public BasePresenter(M im, V iv) {
        this.im = im;
        this.iv = iv;
    }

    @Override//销毁
    public void Destory() {
        if (disposable!=null){
            disposable.dispose();
            disposable=null;
        }
    }
}
